<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal" id="routeForm"
							enctype="multipart/form-data">
							<fieldset>
								<legend>基础配置</legend>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="fromPath">原始路径</label>
									<div class="col-sm-4">
										<input class="form-control" id="fromPath" name="fromPath"
											th:value="${route.fromPath}" type="text" placeholder="path" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="fromPathpattern">路径匹配</label>
									<div class="col-sm-4">
										<input id="fromPathpattern" name="fromPathpattern"
											th:value="${route.fromPathpattern}" class="form-control"
											type="text" placeholder="pathpattern" />
									</div>
								</div>
								<div class="form-group">
									<label for="rpc" class="col-sm-2 control-label">是否RPC</label>
									<div class="col-sm-4">
										<select id="rpc" name="rpc" th:value="${route.rpc}"
											class="form-control">
											<option value="0" th:selected="${route.rpc ==false}">否</option>
											<option value="1" th:selected="${route.rpc ==true}">是</option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="toHostport">目标地址</label>
									<div class="col-sm-4">
										<input class="form-control" id="toHostport" name="toHostport"
											th:value="${route.toHostport}" type="text"
											placeholder="hostAndPort" />
									</div>
									<label class="col-sm-2 control-label" for="toPath">目标路径</label>
									<div class="col-sm-4">
										<input id="toPath" name="toPath" class="form-control"
											th:value="${route.toPath}" type="text" placeholder="path" />
									</div>
								</div>
							</fieldset>
							<fieldset>
								<legend>Rest服务发现</legend>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="serviceId">服务ID</label>
									<div class="col-sm-4">
										<input class="form-control" id="serviceId" name="serviceId"
											th:value="${route.serviceId}" type="text"
											placeholder="serviceId" />
									</div>
								</div>
							</fieldset>
							<fieldset>
								<legend>Rpc服务发现</legend>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="serviceName">服务名</label>
									<div class="col-sm-10">
										<input class="form-control" id="serviceName"
											th:value="${route.serviceName}" name="serviceName"
											type="text" placeholder="serviceName" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="methodName">方法名</label>
									<div class="col-sm-10">
										<input class="form-control" id="methodName" name="methodName"
											th:value="${route.methodName}" type="text"
											placeholder="methodName" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="serviceGroup">组别</label>
									<div class="col-sm-10">
										<input class="form-control" id="serviceGroup"
											th:value="${route.serviceGroup}" name="serviceGroup"
											type="text" placeholder="group" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="serviceVersion">版本</label>
									<div class="col-sm-10">
										<input class="form-control" id="serviceVersion"
											th:value="${route.serviceVersion}" name="serviceVersion"
											type="text" placeholder="version" />
									</div>
								</div>
							</fieldset>
							<fieldset>
								<legend>dubbo参数定义</legend>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="inputParam">dubbo入参类名</label>
									<div class="col-sm-10">
										<input class="form-control" id="inputParam" name="inputParam"
											th:value="${route.inputParam}" type="text"
											placeholder="inputParam" />
									</div>
								</div>
							</fieldset>
							<fieldset>
								<legend>gRpc参数定义</legend>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="zipFile">gRpc
										Proto定义</label>
									<div class="col-sm-4">
										<span id="zipfilename" style="vertical-align: left">未上传文件</span>
										<div class="file-container"
											style="display: inline-block; position: relative; overflow: hidden; vertical-align: middle">
											<button class="btn btn-success fileinput-button"
												type="button">上传</button>
											<input type="file" id="zipFile" name="zipFile"
												onchange="loadZipFile(this.files[0])"
												style="position: absolute; top: 0; left: 0; font-size: 34px; opacity: 0">
										</div>
										<span class="help-block">(包括服务定义、入参、出参的proto文件,以zip包的方式提交)</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="serviceFileName">服务文件名</label>
									<div class="col-sm-10">
										<input class="form-control" id="serviceFileName"
											th:value="${route.serviceFileName}" name="serviceFileName"
											type="text" placeholder="serviceFileName" />
									</div>
								</div>
							</fieldset>
							<fieldset>
								<div class="form-group">
									<div class="col-sm-12" align="center">
										<button type="submit" class="btn btn-primary">提交</button>
									</div>
								</div>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script>
		function loadZipFile(file) {
			$("#zipfilename").html(file.name);
		}
		function loadInputFile(file) {
			$("#inputname").html(file.name);
		}
		function loadOutputFile(file) {
			$("#outputname").html(file.name);
		}
	</script>
	<script type="text/javascript" src="/js/appjs/filter/route/edit.js"></script>
</body>
</html>
